package com.yowasa.xiuxian.engine.battle.enemy.mental;


import com.google.common.collect.Lists;
import com.yowasa.xiuxian.annoations.Mental;
import com.yowasa.xiuxian.constant.XiuxianConstants;
import com.yowasa.xiuxian.engine.hone.MentalInterface;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bo.user.UserBattle;
import com.yowasa.xiuxian.entity.enums.ElementEnum;
import com.yowasa.xiuxian.exception.HandlerException;
import com.yowasa.xiuxian.service.helper.UserTagHelper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Mental(name = "稻妻怪物")
public class DaoQiGuaiWu implements MentalInterface {
    @Autowired
    private UserTagHelper userTagHelper;
    @Override
    public ElementEnum getElement() {
        return null;
    }

    @Override
    public void limit(UserBO user) {
        throw new HandlerException("无法学习妖兽的心法");
    }

    @Override
    public String limitDesc() {
        return "无法学习";
    }

    @Override
    public String desc() {
        return "无属性妖兽心法,妖兽修习的基本心法,提供全方面的额外强化(血量/物理/术法/防御/免疫)";
    }

    @Override
    public List<String> bsList() {
        return Lists.newArrayList("斩无赦");
    }

    @Override
    public String breakUp(UserBO user) {
        int value = userTagHelper.getValue(user.getUserId(), XiuxianConstants.TAG_FEISHENG);
        value = value >= 9 ? 9:value;
        double v = 1 + 0.28 * value;
        user.getUserConfig().setLife(user.getUserConfig().getLife() + 30 * value);
        UserBattle upBattle = getBaseUp(user);
        upBattle.setHp((int) ((upBattle.getHp() + 70) * v));
        upBattle.setChp(upBattle.getHp());
        upBattle.setMp((int) ((upBattle.getMp() + 30) * v));
        upBattle.setCmp(upBattle.getMp());
        upBattle.setAtk((int) ((upBattle.getAtk() + 25) * v));
        upBattle.setSpell((int) ((upBattle.getSpell() + 25) * v));
        upBattle.setSpd((int) ((upBattle.getSpd()+40) * v));
        upBattle.setDef((int) ((upBattle.getDef()+50) * v));
        upBattle.setRes((int) ((upBattle.getRes() + 50) * v));
        upBattle.setImm((int) (upBattle.getImm() * v));
        buildNewUpBattle(user, upBattle);
        return upBattle.getUpDesc();
    }



}
